#!/usr/bin/env bash
################################################################################
#
# plux - quickly run chmod +x; ls -Fl on argument $1
#
# A simple BASH script to run chmod +x on the file you feed it.
# For example, if you want to make a file called myscript.sh executable, run:
# [shell]$ plux ./myscript.sh
#
# @author David Christian Liedle <david.liedle@gmail.com>
# @copyright Copyright (c) 2009-2011 David Christian Liedle                    #
# @license Released under the terms of the MIT Open Source license
#          available here:
#          http://www.opensource.org/licenses/mit-license.php
#
# Released as part of The CLIMAX/Candy Suite: http://climax.googlecode.com/
#
################################################################################
#

if [ $# = 1 ]; then
    
    echo -n "Running chmod +x on ${1}: "
    chmod +x $1
    echo "Result:"
    ls -lF $1
    
else

    # Add an else if to test for -x flag, which REMOVES x bit on the file instead of adding it.
    echo "I need a single argument... Feed me a filename, and I will chmod +x it!"
    echo "Plux adds +x to a file, making it executable."
    echo "Usage: plux <filename>"
    exit 1
    
fi

#########
# Dasit.

exit 0
